<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>新品游戏后台管理</title>
    <link href="__CSS__/boot.css" rel="stylesheet">
    <link href="__STATIC__/layui/css/layui.css" rel="stylesheet">
    <script src="__JS__/jquery.js"></script>
    <script src="__JS__/layer/layer.js"></script>
    <script src="__STATIC__/layui/layui.js"></script>
    <style>
        th{
            text-align: center;
            vertical-align: middle!important;
        }
    </style>
</head>
<body>
    {include file="base/header" /}
    <br/>
    <button type="button" onclick="order(5,{$id})" class="btn btn-primary">已付款</button>
    <button type="button" onclick="order(4,{$id})" class="btn btn-info">未付款</button>
    <div style="float: right;margin-bottom: 5px" class="box-title ">
        <form class="form-inline" action="{:url('index/settlement/order')}" method="get">
            <input type="hidden" name="id" value="{$id}"/>
            <input type="hidden" name="status" value="{$status}">
            <input type="text" name="title" value="<?php if(isset($title)) echo $title ?>" class="form-control" id="exampleInputEmail3" >
            <input type="submit" class="btn btn-default" value="搜索"/>
            <input type="button" onclick="res({$id})" value="全部显示" class="btn btn-default"/>
        </form>
    </div>
    <table class="table table-bordered" style="width: 1300px;margin: 0 auto">
        <tr>
            <th>订单号</th>
            <th>下单日期</th>
            <th>操作</th>
        </tr>
        {foreach $result as $val}
        <tr id="del{$val.id}" style="text-align: center">
            <td>{$val.ordernumber}</td>
            <td>{$val.date}</td>
            <td>
                <button onclick="orderDetail({$val.ordernumber},{$id})" type="button" class="btn btn-primary btn-xs" >订单详情</button>

            </td>
        </tr>
        {/foreach}
    </table>
    <div style="margin-left: 30px">{$result->render()}</div>
</body>
<script>
    //查看是否付款
    function order(status,id) {
        window.location.href = "{:url('index/settlement/order')}?status="+status+"&id="+id;
    }
    //显示全部
    function res(id) {
        window.location.href = "{:url('index/settlement/order')}?id="+id;
    }
    //查看订单详情
    function orderDetail(ordernumber,bid) {
        window.location.href = "{:url('index/settlement/detail')}?bid="+bid+"&ordernumber="+ordernumber;
    }

</script>
</html>